{include file="common/header"/}
<style>
  img {
    width: 100px;
    height: 100px;
  }
</style>
<div class="lemo-container">
  <div class="lemo-main">
      <div class="admin-main layui-anim layui-anim-upbit">
          <fieldset class="layui-elem-field layui-field-title">
              <legend>添加商品</legend>
          </fieldset>
      <form class="layui-form layui-form-pane" action="">
          <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
              <input type="text"  name="name" required  lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
            </div>
          </div>

          

          <div class="layui-form-item">
            <label class="layui-form-label">材质</label>
            <div class="layui-input-block">
              <input type="text"  name="material" required  lay-verify="required" placeholder="请输入材质" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">数量</label>
            <div class="layui-input-block">
              <input type="text"  name="num" required  lay-verify="required" placeholder="请输入进货价" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">进货价</label>
            <div class="layui-input-block">
              <input type="text"  name="buying_price" required  lay-verify="required" placeholder="请输入进货价" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">箱规</label>
            <div class="layui-input-block">
              <input type="text"  name="box_gauge" required  lay-verify="required" placeholder="请输入厂家" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">厂家</label>
            <div class="layui-input-block">
              <input type="text"  name="manufacturer" required  lay-verify="required" placeholder="请输入厂家" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">日期</label>
            <div class="layui-input-block">
              <input type="text" name="price_adjustment_date" class="layui-input" id="ID-laydate-demo" placeholder="请选择日期">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <input type="hidden" name="pic" id="avatar">
            <div class="layui-input-inline">
                <div class="layui-upload">
                    <button type="button" class="layui-btn layui-btn-primary" data-path="user" id="uploads"><i class="icon icon-upload3"></i>点击上传</button>
                    <div class="layui-upload-list">
                        <img class="layui-upload-img" id="addPic">
                        <p id="notice"></p>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
          <label class="layui-form-label">备注</label>
          <div class="layui-input-block">
            <textarea name="notes" placeholder="请输入内容" class="layui-textarea"></textarea>
          </div>
        </div>

        <div class="layui-form-item">
          <div class="layui-input-inline">
              <input type="hidden" name="id"  >
              <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
              <a data-href="{:url('index')}" class="layui-btn layui-btn-primary back">{:lang('back')}</a>
          </div>
      </div>
        </form>
  </div>
  </div>
</div>
  {include file="common/footer"/}

<script>
  layui.config({
      base: '/static/admin/js/',
      version: true
  }).extend({
      Admin: 'Admin',
  }).use(['form','Admin', 'laydate'], function () {
      var form = layui.form, layer = layui.layer,$= layui.jquery, laydate = layui.laydate;
      var info = '';
      info = {:json_encode($info)};
      form.val("form", info);
      if(info){
          $('#addPic').attr('src',info.avatar);
      }
      laydate.render({
        elem: '#ID-laydate-demo',
        type: 'date',
        value: new Date(),
      });
      form.render();
      
  });
</script>